package com.zzg.author.shrio.enums;

import lombok.Getter;

/**
 * 系统用户状态枚举值
 * 
 * @author zzg
 *
 */
public enum SysUserStatusEnum {
	NORMAL(1, "正常"), DISABLE(2, "禁用");
	@Getter
	private Integer code;
	@Getter
	private String describe;

	SysUserStatusEnum(int code, String describe) {
		this.code = code;
		this.describe = describe;
	}

	public static SysUserStatusEnum get(Integer code) {
		if (null == code) {
			return NORMAL;
		}
		SysUserStatusEnum[] sysUserStatusEnums = SysUserStatusEnum.values();
		for (SysUserStatusEnum statusEnum : sysUserStatusEnums) {
			if (statusEnum.getCode().equals(code)) {
				return statusEnum;
			}
		}
		return NORMAL;
	}
}
